package com.shu.lettuce;

import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.sync.RedisCommands;

/**
 * @author ssm
 * @version V1.0
 * @description:
 * @date 2021/7/12 15:47
 */

public class Test1 {

    public static void main(String[] args) {
        // RedisClient redisClient = RedisClient.create("redis://password@localhost:6379/0");
        RedisClient redisClient = RedisClient.create("redis://localhost/0");
        StatefulRedisConnection<String, String> connection = redisClient.connect();

        System.out.println("Connected to Redis");
        connection.sync().set("key", "Hello World");

        connection.close();
        redisClient.shutdown();

    }
}
